<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>${i.content}</title>
</head>
<body>
#{extends 'main.html' /}
#{ifErrors} ${error} #{/ifErrors}

<br />
<br />
</label>
<p>&nbsp;</p>
<p><label id="Label3">${i.content}</label></p>
<p>&nbsp;</p>
<p>
#{if i.author.id ==ui}
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href ="@{Application.addIdeaTag(i.id, t.id, d.id)}" >Tag</a>
#{/if}
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="@{Application.report()}">Report</a>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="@{Application.share(i.id)}">Share</a> </p>
<hr />

<form name="myform" action="@{Application.addComment(i.id,t.id,d.id)}" method="post" >
#{if i.state==1}
<p>
   <textarea cols="20" name="content" rows="2" id="TextArea1" ></textarea>
</p>
	<input  type="submit" value="comment"/>
#{/if}	
</form>
#{if roleIsIdeaDeveloper==false || i.author.id==userId}
<form name="myform" action="@{Application.deleteIdea(i.id,t.id,d.id)}" method="post" >
<input name="delete" type="submit" value="delete" />
</form>
#{/if}
<p>&nbsp;</p>
<p>&nbsp;</p>
#{if i.comments}
#{list items:i.comments, as:'comment'}
&nbsp;commented by:&nbsp;
${comment.user.nickName}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at: ${comment.pDate}
<p>&nbsp;</p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${comment.content}
<p>&nbsp;</p>
<a href = "@{Application.quotedComment(i.id,comment.id,t.id,d.id)}">quote and replay</a>
&nbsp;&nbsp;&nbsp;
<a href="@{Application.report()}">Report</a>
<hr />
#{/list}
#{/if}
#{else}
No comment in the idea !!
#{/else}

#{if ratedBef==true}
<form action="@{Application.rateIdea()}">
<input type = "hidden" value="${i.id}" name="ideaId">
<input type = "hidden" value="${d.id}" name="departmentId">
<input type = "hidden" value="${t.id}" name="topicId">
&nbsp; &nbsp; Rate Idea:<select name="rate">
<option value="1">1 </option>
<option value="2">2 </option>
<option value="3">3 </option>
<option value="4">4 </option>
<option value="5">5 </option>
</select>  &nbsp; <input
type="submit" disabled="disabled" value="rate">
<span
style="color: #c00" class="error">#{error 'rate' /}</span>
</form>
You Have Rated This Idea! 
#{/if}	

#{else}
<form action="@{Application.rateIdea()}">
 <input type = "hidden" value="${i.id}" name="ideaId">
  <input type = "hidden" value="${d.id}" name="departmentId">
   <input type = "hidden" value="${t.id}" name="topicId">
	&nbsp; &nbsp; Rate Idea:<select name="rate">
		<option value="1">1 </option>
		<option value="2">2 </option>
		<option value="3">3 </option>
		<option value="4">4 </option>
		<option value="5">5 </option>
	</select>  &nbsp; <input
		type="submit" value="rate">
		<span
		style="color: #c00" class="error">#{error 'rate' /}</span>
		</form>
#{/else}


<br>
<a href ="@{Application.showTopic(t.id, d.id)}" >  go back to ${t.title}</a>
<br>
<br>

</body>

</html>
